<template>
  <div class="goods-state table-theme">
    <head-title title="数据-产品统计"></head-title>
    <el-card>
      <div class="top-menu">
        <div class="menu-left">
        </div>
        <div class="menu-right">
          <refresh-button @refresh="refreshPage"></refresh-button>
          <div class="add">
            <el-button type="primary" @click="onExport">导出</el-button>
          </div>
        </div>
      </div>
      <p style="height: 30px"></p>
      <el-table :data="list">
        <!-- <el-table-column
          label="序号"
          align="center"
          width="80"
        ></el-table-column> -->
        <el-table-column label="风格" align="center" prop="style"></el-table-column>
        <el-table-column
          label="系列数"
          align="center"
          prop="series_count"
        ></el-table-column>
        <el-table-column
          label="产品总数"
          align="center"
          prop="goods_count"
        ></el-table-column>
        <el-table-column
          label="工厂数"
          align="center"
          prop="factory_count"
        ></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'goods-state',
  data () {
    return {
      list: [],
    };
  },
  components: {},
  computed: {},
  mounted(){
    this.init()
  },
  methods: {
    init(e) {
      this.$http(this.$ApiList.GoodsStatisticsData, {}).then((res) => {
        this.list = res.datas
      });
    },
    // 刷新
    refreshPage() {
      this.init();
    },
    // 导出
    onExport(){
      let url = `${this.$domain}furniture/Adminexcel/GoodsStatisticsDataExcel?secret=888`
      window.location.href = url
    }
  }
}
</script>

<style lang='scss' scoped>

</style>